import React from 'react'
import {connect} from 'react-redux'
import  {getProduct_Index_List} from "../../../../redux/product_index/product_index.redux";
import './style.css'
import  HomeSearch from  '../search/Search'
import  Swiper from '../../../../components/Swiper/swiper'
import  HomeGrid from  '../HomeGrid/HomeGrid'
import AwardImg from  '../../../../components/AwardImg/AwardImg'
// 装饰器模式
@connect(
    state=>state.userlist,
    {getProduct_Index_List}
)
class HomeTop extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            HomeTop_bg:require('./img/HomeTop_bg.png')
        };
    }
    componentDidMount() {

    }
    componentWillReceiveProps(nextProps){

    }
    render(){
        return (
            <div style={{
                width: '7.5rem',
                height: '8.64rem',
                backgroundSize:'cover',
                background: 'url('+this.state.HomeTop_bg+') center center /  7.5rem 8.64rem no-repeat' }}>
                 <HomeSearch />
                 <Swiper HomeTopSwiperData={this.props.HomeTopSwiperData} data={this.props.data} />
                 <HomeGrid user_code={this.props.user_code} HomeTopClassData={this.props.HomeTopClassData} />
                 <AwardImg />
            </div>
        )
    }
}
export default HomeTop